<template>
    <div id="out">
        <div class="moon"></div>
        <div class="moon-crater moon-crater1"></div>
        <div class="moon-crater moon-crater2"></div>
        <div class="moon-crater moon-crater3"></div>

        <div class="star star1"></div>
        <div class="star star2"></div>
        <div class="star star3"></div>
        <div class="star star4"></div>
        <div class="star star5"></div>

        <div v-if="tipType === '404'" class="error">
            <div class="error-title">404</div>
            <div class="error-subtitle">Hmmm...</div>
            <div class="error-description">当前资源不存在...</div>
        </div>
        <div v-if="tipType" class="error">
            <div class="error-title">404</div>
            <div class="error-subtitle">Hmmm...</div>
            <div class="error-description">当前资源不存在...</div>
        </div>
        <div class="astronaut">
            <div class="astronaut-backpack"></div>
            <div class="astronaut-body"></div>
            <div class="astronaut-body-chest"></div>
            <div class="astronaut-arm-left1"></div>
            <div class="astronaut-arm-left2"></div>
            <div class="astronaut-arm-right1"></div>
            <div class="astronaut-arm-right2"></div>
            <div class="astronaut-arm-thumb-left"></div>
            <div class="astronaut-arm-thumb-right"></div>
            <div class="astronaut-leg-left"></div>
            <div class="astronaut-leg-right"></div>
            <div class="astronaut-foot-left"></div>
            <div class="astronaut-foot-right"></div>
            <div class="astronaut-wrist-left"></div>
            <div class="astronaut-wrist-right"></div>

            <div class="astronaut-cord">
                <canvas id="cord" height="500px" width="500px"></canvas>
            </div>

            <div class="astronaut-head">
                <canvas id="visor" width="60px" height="60px"></canvas>
                <div class="astronaut-head-visor-flare1"></div>
                <div class="astronaut-head-visor-flare2"></div>
            </div>
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
    name: '404',
    components: {},
    data() {},
    // 监听属性 类似于data概念
    computed: {
        tipType() {
            return '404';
        },
    },
    // 监控data中的数据变化

    // 方法集合
    methods: {},
});
</script>
<style lang="scss" scoped>
#out {
    @keyframes shimmer {
        from {
            opacity: 0;
        }

        to {
            opacity: 0.7;
        }
    }

    overflow: hidden;
    width: 100%;
    height: 100vh;
    background: linear-gradient(90deg, #2f3640 23%, #181b20 100%);

    .moon {
        content: '';
        position: absolute;
        top: -100px;
        left: -300px;
        width: 900px;
        height: 900px;
        border-radius: 100%;
        background: linear-gradient(90deg, #d0d0d0 48%, #919191 100%);
        box-shadow: 0 0 30px -4px rgb(0 0 0 / 50%);
    }

    .moon-crater {
        content: '';
        position: absolute;
        border-radius: 100%;
        background: linear-gradient(90deg, #7a7a7a 38%, #c3c3c3 100%);
        opacity: 0.6;
    }

    .moon-crater1 {
        top: 250px;
        left: 500px;
        width: 60px;
        height: 180px;
    }

    .moon-crater2 {
        top: 650px;
        left: 340px;
        width: 40px;
        height: 80px;
        transform: rotate(55deg);
    }

    .moon-crater3 {
        top: -20px;
        left: 40px;
        width: 65px;
        height: 120px;
        transform: rotate(250deg);
    }

    .star {
        content: '';
        position: absolute;
        width: 5px;
        height: 5px;
        border-radius: 100%;
        background: grey;
        opacity: 0.4;
        transform: rotate(250deg);
        animation-name: shimmer;
        animation-duration: 1.5s;
        animation-iteration-count: infinite;
        animation-direction: alternate;
    }

    .star1 {
        top: 40%;
        left: 50%;
        animation-delay: 1s;
    }

    .star2 {
        top: 60%;
        left: 90%;
        animation-delay: 3s;
    }

    .star3 {
        top: 10%;
        left: 70%;
        animation-delay: 2s;
    }

    .star4 {
        top: 90%;
        left: 40%;
    }

    .star5 {
        top: 20%;
        left: 30%;
        animation-delay: 0.5s;
    }

    .error {
        position: absolute;
        top: 400px;
        left: 100px;
        color: #363e49;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
            'Segoe UI Emoji', 'Segoe UI Symbol';
        transform: translateY(-60%);
    }

    .error-title {
        font-size: 10em;
    }

    .error-subtitle {
        font-size: 2em;
    }

    .error-description {
        opacity: 1;
    }

    .error-button {
        min-width: 7em;
        margin-top: 3em;
        margin-right: 0.5em;
        padding: 0.5em 2em;
        border: 2px solid #2f3640;
        border-radius: 8em;
        background-color: transparent;
        color: #576375;
        outline: none;
        font-size: 0.75em;
        font-family: Righteous, cursive;
        cursor: pointer;
        transition-duration: 0.2s;

        &:hover {
            color: #21252c;
        }
    }

    .error-button-active {
        border: 2px solid #e67e22;
        background-color: #e67e22;
        color: white;

        &:hover {
            color: white;
            box-shadow: 0 0 8px 0 rgb(0 0 0 / 50%);
        }
    }

    .astronaut {
        position: absolute;
        top: 50%;
        left: 70%;
        width: 185px;
        height: 300px;
        transform: translate(-50%, -50%) rotate(20deg) scale(1.2);
    }

    .astronaut-head {
        content: '';
        position: absolute;
        top: 60px;
        left: 60px;
        width: 60px;
        height: 60px;
        border-radius: 2em;
        background-color: white;
    }

    .astronaut-head-visor-flare1 {
        content: '';
        position: absolute;
        top: 28px;
        left: 40px;
        width: 10px;
        height: 10px;
        border-radius: 2em;
        background-color: #7f8fa6;
        opacity: 0.5;
    }

    .astronaut-head-visor-flare2 {
        content: '';
        position: absolute;
        top: 40px;
        left: 38px;
        width: 5px;
        height: 5px;
        border-radius: 2em;
        background-color: #718093;
        opacity: 0.3;
    }

    .astronaut-backpack {
        content: '';
        position: absolute;
        top: 90px;
        left: 47px;
        width: 86px;
        height: 90px;
        border-radius: 8px;
        background-color: #bfbfbf;
    }

    .astronaut-body {
        content: '';
        position: absolute;
        top: 115px;
        left: 55px;
        width: 70px;
        height: 80px;
        border-radius: 8px;
        background-color: #e6e6e6;
    }

    .astronaut-body-chest {
        content: '';
        position: absolute;
        top: 140px;
        left: 68px;
        width: 45px;
        height: 25px;
        border-radius: 6px;
        background-color: #d9d9d9;
    }

    .astronaut-arm-left1 {
        content: '';
        position: absolute;
        top: 127px;
        left: 9px;
        width: 65px;
        height: 20px;
        border-radius: 8px;
        background-color: #e6e6e6;
        transform: rotate(-30deg);
    }

    .astronaut-arm-left2 {
        content: '';
        position: absolute;
        top: 102px;
        left: 7px;
        width: 20px;
        height: 45px;
        border-radius: 8px;
        border-top-left-radius: 8em;
        border-top-right-radius: 8em;
        background-color: #e6e6e6;
        transform: rotate(-12deg);
    }

    .astronaut-arm-right1 {
        content: '';
        position: absolute;
        top: 113px;
        left: 100px;
        width: 65px;
        height: 20px;
        border-radius: 8px;
        background-color: #e6e6e6;
        transform: rotate(-10deg);
    }

    .astronaut-arm-right2 {
        content: '';
        position: absolute;
        top: 78px;
        left: 141px;
        width: 20px;
        height: 45px;
        border-radius: 8px;
        border-top-left-radius: 8em;
        border-top-right-radius: 8em;
        background-color: #e6e6e6;
        transform: rotate(-10deg);
    }

    .astronaut-arm-thumb-left {
        content: '';
        position: absolute;
        top: 110px;
        left: 21px;
        width: 10px;
        height: 6px;
        border-radius: 8em;
        background-color: #e6e6e6;
        transform: rotate(-35deg);
    }

    .astronaut-arm-thumb-right {
        content: '';
        position: absolute;
        top: 90px;
        left: 133px;
        width: 10px;
        height: 6px;
        border-radius: 8em;
        background-color: #e6e6e6;
        transform: rotate(20deg);
    }

    .astronaut-wrist-left {
        content: '';
        position: absolute;
        top: 122px;
        left: 6.5px;
        width: 21px;
        height: 4px;
        border-radius: 8em;
        background-color: #e67e22;
        transform: rotate(-15deg);
    }

    .astronaut-wrist-right {
        content: '';
        position: absolute;
        top: 98px;
        left: 141px;
        width: 21px;
        height: 4px;
        border-radius: 8em;
        background-color: #e67e22;
        transform: rotate(-10deg);
    }

    .astronaut-leg-left {
        content: '';
        position: absolute;
        top: 188px;
        left: 50px;
        width: 23px;
        height: 75px;
        background-color: #e6e6e6;
        transform: rotate(10deg);
    }

    .astronaut-leg-right {
        content: '';
        position: absolute;
        top: 188px;
        left: 108px;
        width: 23px;
        height: 75px;
        background-color: #e6e6e6;
        transform: rotate(-10deg);
    }

    .astronaut-foot-left {
        content: '';
        position: absolute;
        top: 240px;
        left: 43px;
        width: 28px;
        height: 20px;
        border-bottom: 4px solid #e67e22;
        border-radius: 3px;
        border-top-left-radius: 8em;
        border-top-right-radius: 8em;
        background-color: white;
        transform: rotate(10deg);
    }

    .astronaut-foot-right {
        content: '';
        position: absolute;
        top: 240px;
        left: 111px;
        width: 28px;
        height: 20px;
        border-bottom: 4px solid #e67e22;
        border-radius: 3px;
        border-top-left-radius: 8em;
        border-top-right-radius: 8em;
        background-color: white;
        transform: rotate(-10deg);
    }
}
</style>
